<?php
	include 'common.php';
	session_start();
	error_reporting(0);
	$userLink = $_SESSION['userLink'];
	if($userLink=="hrpage.php"){
		$link="hr_employee_report.php";
	}
	else if($userLink=="ceo.php"){
		$link="empoyers_info.php";
	}
	$searchingDate = $_POST['date'];
	$searchingMonth = $_POST['month'];
	$searchingYear = $_POST['year'];
	$searchingDate1 = $_POST['date1'];
	$searchingMonth1 = $_POST['month1'];
	$searchingYear1 = $_POST['year1'];
	$emplId = $_POST['id'];	
	$collectSearchingDataFromDb = "SELECT * FROM attendance WHERE e_id = '$emplId' and date between '$searchingYear-$searchingMonth-$searchingDate'and '$searchingYear1-$searchingMonth1-$searchingDate1' ";
	$collectSearchingDataFromDbQuery = mysql_query($collectSearchingDataFromDb);
	//echo $sdfds=mysql_num_rows($collectSearchingDataFromDbQuery);
	/*while($fetchArrayAcordingToTheData = mysql_fetch_array($collectSearchingDataFromDbQuery)){
		$collectDate = $fetchArrayAcordingToTheData['date'];
		$collectDay = $fetchArrayAcordingToTheData['day'];
		$collectInTime = $fetchArrayAcordingToTheData['in_time'];
		$collectSatus = $fetchArrayAcordingToTheData['status'];
		?>
             <tr valign="top" class="table_header_3">
                    <td width="60px"><p><?php echo $collectDate ?></p></td>
                    <td width="60px;"><p><?php echo $collectDay ?></p></td>
                    <td width="60px;"><p><?php echo $collectInTime ?></p></td>
                    <td width="60px;"><p>####</p></td>
                    <td width="60px;"><p><?php echo $collectSatus ?></p></td>
                </tr>
             <?php
				}*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" type="image/ico" href="images/favicon.ico"></link> 
<link rel="shortcut icon" href="images/favicon.ico"></link>
<link rel="stylesheet" type="text/css" href="hr_attendance.css" />
<script src="home.js" type="text/javascript"></script>
<title>Weekly Attendance</title>
</head>

<body>
<div id="main_div">     
    <div class="page_content1">
  		<table align="center"  border="0" cellpadding="0" cellspacing="0" class="header_page_content">
        	<tr class="table_header_1"  valign="top">
            	<td align="center" colspan="8"><?php echo $searchingDate."-".$searchingMonth."-".$searchingYear." To ".$searchingDate1."-".$searchingMonth1."-".$searchingYear1; ?></td>
            </tr>
			<tr valign="top" class="table_header_2">
				<td width="100px"><p>Date</p></td>
                <td width="100px;"><p>Day</p></td>
                <td width="100px;"><p>In Time</p></td>
                <td width="100px;"><p>Out Time</p></td>
                <td width="100px;"><p>Status</p></td>               
			</tr>
    </table>	
		<table align="center" class="header_page_content" border="0" cellpadding="0" cellspacing="0">
        <?php
		while($fetchArrayAcordingToTheData = mysql_fetch_array($collectSearchingDataFromDbQuery)){
			$collectDate = $fetchArrayAcordingToTheData['date'];
			$collectDay = $fetchArrayAcordingToTheData['day'];
			$collectInTime = $fetchArrayAcordingToTheData['in_time'];
			$collectSatus = $fetchArrayAcordingToTheData['status'];
			$collectOutTime = $fetchArrayAcordingToTheData['out_time'];
		?>
			<tr valign="top" class="table_header_3">
                <td width="100px"><p><?php echo $collectDate ?></p></td>
                <td width="100px;"><p><?php echo $collectDay ?></p></td>
                <td width="100px;"><p><?php echo date('h:i A',strtotime($collectInTime)); ?></p></td>
                <td width="100px;"><p><?php echo date('h:i A',strtotime($collectOutTime)); ?></p></td>
                <td width="100px;">                	
						<?php
						if($collectSatus==0){
							?>
                            <p style="color:#F00">Late</p>
                            <?php
						}
						else if($collectSatus==2){
							?>
                            <p style="color:#C90">Absent</p>
                            <?php
						}
						else{
							?>
                            <p style="color:#060">In time</p>
                            <?php
						}
						?>
                </td>
            </tr>
        <?php
		}
		?>
		</table>		
    </div>
    <a href="index.php"><div class="power"><img src="images/power_icon.png" /><p style="color:#FFF">Log-Off</p></div></a>
    <a href="<?php echo $link; ?>?carryId=<?php echo $emplId; ?>">Back To Preveous Page</a>
    <a href="ceo.php"><div class="attendance_home"><img src="images/home_icon.png" /><p style="color:#FFF">Home</p></div></a>
</div>

</body>
</html>




























